package pl.multimedialne.carculator.gui;

import pl.multimedialne.carculator.R;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class GlobalStatsFragment extends Fragment {
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_global_stats,
				container, false);

		return rootView;
	}

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		Spinner statsTypeSpinner = (Spinner) getView().findViewById(
				R.id.stats_type_spinner);
		ArrayAdapter<CharSequence> statsTypeAdapter = ArrayAdapter.createFromResource(
				getActivity(), R.array.stats_types,
				android.R.layout.simple_spinner_item);
		statsTypeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		statsTypeSpinner.setAdapter(statsTypeAdapter);
		
		Spinner timeRangeSpinner = (Spinner) getView().findViewById(
				R.id.time_range_spinner);
		ArrayAdapter<CharSequence> timeRangeAdapter = ArrayAdapter.createFromResource(
				getActivity(), R.array.time_ranges,
				android.R.layout.simple_spinner_item);
		timeRangeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		timeRangeSpinner.setAdapter(timeRangeAdapter);
	}
}
